<template>
  <div class="home">
    <div class="middle">
      <div class="top">
        <el-input type="text" v-model="role"/>
        <el-button type="primary" style="margin: 0 10px" @click="changeUserRole">确定</el-button>
        <span>1表示用户，2表示管理员</span>
      </div>
    </div>
  </div>
</template>

<script type="text/javascript">
import { financeTable } from "../../constants/pages/financeTable";
import Vue from "vue";
export default {
  name: "user-role",

  data() {
    return {
        role: sessionStorage.getItem('role') || 1
    };
  },
  watch: {
    $route: "pageChange"
  },
  mounted() {
    this.init();
  },
  methods: {
    init() {
    },
    changeUserRole() {
      let vm = this;
      sessionStorage.setItem('role', vm.role);
      vm.$store.commit('setUserInfo', {role: vm.role});
    }
  },
  components: {}
};
</script>

<style lang="less" scoped>
</style>
